#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
项目通用常量配置模块
"""

# =====================
# 📦 通用状态码
# =====================

SUCCESS = 0             # 成功
ERROR = 1               # 通用错误
UNAUTHORIZED = 401      # 未登录/Token失效
FORBIDDEN = 403         # 没权限
NOT_FOUND = 404         # 找不到资源
VALIDATION_ERROR = 422  # 参数验证失败
SERVER_ERROR = 500      # 服务内部错误

# =====================
# 📝 编码
# =====================

ASCII_ENCODING = 'ascii'
UTF8_ENCODING = 'utf-8'
DEFAULT_ENCODING = UTF8_ENCODING

# =====================
# 📄 分页配置
# =====================

DEFAULT_PAGE = 1
DEFAULT_PAGE_SIZE = 10
MAX_PAGE_SIZE = 100

# =====================
# 👤 用户配置
# =====================

DEFAULT_AVATAR = "https://cdn.xxx.com/avatar/default.png"
DEFAULT_NICKNAME_PREFIX = "用户_"

# =====================
# 🧾 账单分类类型
# =====================

CATEGORY_TYPE_EXPENSE = "expense"  # 支出
CATEGORY_TYPE_INCOME = "income"    # 收入

CATEGORY_TYPE_LABELS = {
    CATEGORY_TYPE_EXPENSE: "支出",
    CATEGORY_TYPE_INCOME: "收入"
}

# =====================
# 🧧 预算/金额限制
# =====================

MAX_TRANSACTION_AMOUNT = 1_000_000.0  # 单笔最大金额限制
MIN_TRANSACTION_AMOUNT = 0.01

# =====================
# 🧹 软删除状态
# =====================

IS_DELETED = True
NOT_DELETED = False

# =====================
# 📅 时间格式
# =====================

# =====================
# 📅 时间格式
# =====================

# 使用短横线(-)分隔的日期时间格式，适用于需要人类可读性较好的场景
DATE_FORMAT_DASH = "%Y-%m-%d"                      # 日期格式：2023-01-01
TIME_FORMAT_DASH = "%H:%M:%S"                      # 时间格式：13:00:00
TIME_FORMAT_SHORT_DASH = "%H:%M"                   # 短时间格式：13:00
DATETIME_FORMAT_DASH = "%Y-%m-%d %H:%M:%S"         # 日期时间格式：2023-01-01 13:00:00
DATETIME_FORMAT_SHORT_DASH = "%Y-%m-%d %H:%M"      # 短日期时间格式：2023-01-01 13:00

# 紧凑型日期时间格式(无分隔符)，适用于需要节省空间或作为标识符的场景
DATE_FORMAT_COMPACT = "%Y%m%d"                     # 日期格式：20230101
TIME_FORMAT_COMPACT = "%H%M%S"                     # 时间格式：130000
TIME_FORMAT_SHORT_COMPACT = "%H%M"                 # 短时间格式：1300
DATETIME_FORMAT_COMPACT = "%Y%m%d%H%M%S"           # 日期时间格式：20230101130000
DATETIME_FORMAT_SHORT_COMPACT = "%Y%m%d%H%M"       # 短日期时间格式：202301011300


# =====================
# 🗂️ 其他常量
# =====================

SYSTEM_USER_ID = 0  # 表示系统内置分类使用的 user_id
